package com.bruce.demo2.patterns.demo1.creational.demo05.builder.demo1;

/**
 * @PROJECT_NAME design_patterns
 * @DESCRIPTION 测试类
 * @AUTHOR CNBruceLee
 * @DATE 2021/7/12 22:06
 */
public class Test {
    @org.junit.Test
    public void test() {
        //创建指挥者对象
        Director director1 = new Director(new MobikeBuilder());
        //让指挥着组装自行车
        Bike bike1 = director1.construct();//用户无需知道具体的构建过程，结果是获得了一辆摩拜单车
        System.out.println(bike1.getFrame());
        System.out.println(bike1.getSeat());

        System.out.println("=============================");
        Director director2 = new Director(new OfoBuilder());
        Bike bike2 = director2.construct();
        System.out.println(bike2.getFrame());
        System.out.println(bike2.getSeat());
    }
}
